package PTA.Mianxiangduixiang.ex25;

import java.util.Scanner;
class square{
    private int edge;

    public int getEdge() {
        return edge;
    }

    public void setEdge(int edge) {
        if (edge <= 0) {
            this.edge = 1;
        } else {
            this.edge = edge;
        }
    }
    public square() {
        this.edge = 2;
        System.out.println("this is constructor method");
    }


    public int getArea(){
int area = 0;
area = edge*edge;
return area;
    }


}


public class ex25 {
    public static void main(String[] args) {
        Scanner sc=  new Scanner(System.in);
int a = sc.nextInt();
        square s1 = new square();
        System.out.println("s1:edge="+s1.getEdge());
        System.out.println("s1:area="+s1.getArea());
        square s2 = new square();
        s2.setEdge(a);
        System.out.println("s2:edge="+s2.getEdge());
        System.out.println("s2:area="+s2.getArea());
    }
}
